/*
 * 
 * 系统管理
 * 
 */

//管理员列表
function adminList(el){
	liStyle(el);
//	$("#indexIframe").attr("src","sys/adminList.html");
}



//运营列表
function businessList(el){
	liStyle(el);
	$("#indexIframe").attr("src","sys/businessList.html");
}
//客服列表
function kefuList(el){
	liStyle(el);
	$("#indexIframe").attr("src","sys/kefuList.html");
}


//添加管理员
function addAdmin(el){
	liStyle(el);
//	$("#indexIframe").attr("src","sys/addAdmin.html");
}

//管理员操作日志
function adminDoLog(el){
	liStyle(el);
//	$("#indexIframe").attr("src","sys/adminDoLog.html");
}

//管理员添加金币记录
function adminAddMoneyLog(el){
	liStyle(el);
//	$("#indexIframe").attr("src","sys/adminAddMoneyLog.html");
}

//管理员添加奖券记录
function adminAddLotteryLog(el){
	liStyle(el);
//	$("#indexIframe").attr("src","sys/adminAddLotteryLog.html");
}

//用户点控记录
function adminPointControlLog(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/playerInfo/playerDianKongList.php");
}

//房间配置
function roomSet(el){
	liStyle(el);
	$("#indexIframe").attr("src","sys/roomSet/roomSet.html");
}

//充值配置列表
function rechargeSetList(el){
	liStyle(el);
//	$("#indexIframe").attr("src","sys/rechargeSetList.html");
}

//添加充值配置
function addRechargeSet(el){
	liStyle(el);
//	$("#indexIframe").attr("src","sys/addRechargeSet.html");
}

//活动奖励列表
function activityRewardList(el){
	liStyle(el);
//	$("#indexIframe").attr("src","sys/activityRewardList.html");
}

//添加活动奖励配置
function addActivityRewardSet(el){
	liStyle(el);
//	$("#indexIframe").attr("src","sys/addActivityRewardSet.html");
}

//游戏包管理
function GamePackManagement(el){
	liStyle(el);
//	$("#indexIframe").attr("src","sys/GamePackManagement.html");
}

//平台当日记录
function platformDetailsRecording(el){
	liStyle(el);
	$("#indexIframe").attr("src","sys/platformDetailsRecording.html");
}

//平台汇总明细
function platformSummaryDetails(el){
	liStyle(el);
	$("#indexIframe").attr("src","sys/platformSummaryDetails.html");
}

/*
 * 
 * 玩家管理
 * 
 */

//搜索玩家
function searchPlayer(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/searchPlayerList.html");
}

//玩家在线列表
function playerOnlineList(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/playerOnlineList.html");
}

//输赢控制表
function winLoseControlList(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/winLose/fuFeiUserWinLoseControlList.html");
}

//当日交易列表
function playerDayTransaction(el){
	liStyle(el);
//	$("#indexIframe").attr("src","player/playerDayTransaction.html");
}

//实物兑换记录
function playerExchangeList(el){
	liStyle(el);
//	$("#indexIframe").attr("src","player/playerExchangeList.html");
}

//充值记录
function playerRechargeList(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/playerChongZhiList.php");
}

//兑换话费记录
function duiHuanHuaFeiList(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/duiHuanHuaFeiList.html");
}

//金币变动记录
function moneyChangeList(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/playerInfo/playerGoldChangeList.php");
}

//奖券变动记录
function lotteryChangeList(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/playerInfo/playerLotteryChangeList.php");
}

//用户登录记录
function loginLogList(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/playerInfo/playerLoginLogList.php");
}

//用户输赢搜索
function playerWinningOrLosing(el){
	liStyle(el);
//	$("#indexIframe").attr("src","player/playerWinningOrLosing.html");
}

//用户转账记录
function playerTransferLog(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/playerTransferLog.html");
}

//礼物赠送记录
function playerGiftSendLog(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/playerInfo/playerGiftSendList.php");
}

function controlByIP(el){
	liStyle(el);
	$("#indexIframe").attr("src","player/controlByIP.html");
}

/*
 * 
 * 图表数据
 * 
 */

//用户在线统计
function userOnlineCount(el){
	liStyle(el);
	$("#indexIframe").attr("src","charts/userOnlineCount/onlineDataCount.html");
}

//留存率统计
function retentionRateCount(el){
	liStyle(el);
	$("#indexIframe").attr("src","charts/retentionRate/retentionRateCount.html");
}

//话费产出
function huaFeiOutPut(el){
	liStyle(el);
	$("#indexIframe").attr("src","charts/huaFeiOutput/huaFeiChanChuCount.html");
}

/*
 * 
 * 至尊VIP
 * 
 */

//银商金币增加查询
function yinShangScore(el){
	liStyle(el);
	$("#indexIframe").attr("src","vip/yinShangScoreChangeList.html");
}



/**
 * 批量创建银商
 * @param el
 */
function createYinShang(el){
	liStyle(el);
	$("#indexIframe").attr("src","vip/createYinShang.html");
}


/**
 * 银商列表
 * @param el
 */
function yinShangList(el){
	liStyle(el);
	$("#indexIframe").attr("src","vip/yinShangList.html");
}

/**
 * 随机生成兑换码
 * @param el
 */
function createRandCode(el){
	liStyle(el);
	$("#indexIframe").attr("src","vip/createRandCode.html");
}

/**
 * 兑换码列表
 * @param el
 * @constructor
 */
function RandCodeList(el){
	liStyle(el);
	$("#indexIframe").attr("src","vip/randCodeList.html");
}


//平台返利
function platformRebate(el){
	liStyle(el);
	$("#indexIframe").attr("src","vip/platformRebate.html");
}


function everyBalance(el){
	liStyle(el);
	$("#indexIframe").attr("src","vip/everyBalance.php");
}



/*
 * 公告列表
 */

function openGongGaoList(el){
	liStyle(el);
	$("#indexIframe").attr("src","sys/gonggao/gongGaoList.html");
}

/*
 *通告发布 开始
 */
//打开发布通告的弹框
function openMsgWindow(){
	// liStyle(el);
	$("#indexIframe").attr("src","sys/tonggao/tongGaoList.html");
	// $("#msgWindow").modal("show");
}
//提交通告，并发布
function addMessage(){
	//获取消息内容
	var content = $.trim($("#msgContent").val());
	
	if(content == ""){
		$("#msgContent").css("border","1px solid red");
	}else{
		$("#msgContent").css("border","");
		
		//ajax 请求
		$.ajax({
			type: "post",
			data: {"content":content},
			url: "../php/sys/msg/sendTongGao.php",
			beforeSend: function(){
				$("#load").css("display","block");
			},
			success: function(msg){
				$("#load").css("display","none");
				if(msg == "1"){
					cancelMesFaBu();//关闭当前弹框
					$("#promptWindow").modal("show");
				}else{
					alert(msg);
				}
			}
		});
	}
}
//取消发布，清空内容
function cancelMesFaBu(){
	$("#load").css("display","none");
	$("#msgWindow").modal("hide");
	$("#msgContent").val("").css("border","");
}
/*
 * 通告发布 结束
 */

$(function(){
	setFrameHeight();
	window.resize=setFrameHeight();
	
	$("#sysTime").html(getNowFormatDate());
	setInterval(function(){
		$("#sysTime").html(getNowFormatDate());
	},1000);
	
});

$(window).resize(function(){
	setFrameHeight();
});

//设置iframe高度
function setFrameHeight(){
	var h = document.documentElement.clientHeight;
	var height = h+"px";
	$("#indexIframe").attr("height",height);
}

function liStyle(obj){
	$("li[id!='home']").removeClass("active");
	$(obj).parent().addClass("active");
}

//js获取当前时间
function getNowFormatDate() {
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    
    var month = date.getMonth() + 1;//月份
    if (month >= 1 && month <= 9) {month = "0" + month;}

	var strDate = date.getDate();//天
    if (strDate >= 0 && strDate <= 9) {strDate = "0" + strDate;}
    
    var hours = date.getHours();//小时
    if (hours >= 0 && hours <= 9) {hours = "0" + hours;}
    
    var min = date.getMinutes();//分
    if (min >= 0 && min <= 9) {min = "0" + min;}
    
    var s = date.getSeconds();//秒
    if (s >= 0 && s <= 9) {s = "0" + s;}
    
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
            + " " + hours + seperator2 + min
            + seperator2 + s;
    return currentdate;
}